<!--
描述：教学安排-排课设置-新增组件
开发人：hqj
开发日期：2018年8月3日
-->

<template lang="pug">
    kalix-dialog.user-add(bizKey="courseArrangement" ref="kalixBizDialog" v-bind:form-model.sync="formModel" v-bind:targetURL="targetURL")
        div.el-form(slot="dialogFormSlot")
            div.s-flex
                el-form-item.s-flex_item(label="学期上课周数" prop="classWeeks" v-bind:rules="rules.classWeeks" v-bind:label-width="labelWidth")
                    el-input-number(v-model="formModel.classWeeks")
                el-form-item.s-flex_item(label="周排课天数" prop="classPerWeekDays" v-bind:rules="rules.classPerWeekDays" v-bind:label-width="labelWidth")
                    el-radio-group(v-model="formModel.classPerWeekDays")
                        el-radio(label='5') 五天
                        el-radio(label='6') 六天
                        el-radio(label='7') 七天
            div.table-title 日排课节数
            el-form-item.s-flex(label="上午" prop="classMorningSections" v-bind:rules="rules.classMorningSections" v-bind:label-width="labelWidth")
                el-radio-group(v-model="formModel.classMorningSections")
                    el-radio(label='4') 四节
                    el-radio(label='5') 五节
                    el-radio(label='6') 六节
            el-form-item.s-flex(label="下午" prop="classAfternoonSections" v-bind:rules="rules.classMorningSections" v-bind:label-width="labelWidth")
                el-radio-group(v-model="formModel.classAfternoonSections")
                    el-radio(label='0') 不排
                    el-radio(label='2') 二节
                    el-radio(label='3') 三节
                    el-radio(label='4') 四节
                    el-radio(label='5') 五节
                    el-radio(label='6') 六节
            el-form-item.s-flex(label="晚上" prop="classEveningSections" v-bind:rules="rules.classMorningSections" v-bind:label-width="labelWidth")
                el-radio-group(v-model="formModel.classEveningSections")
                    el-radio(label='0') 不排
                    el-radio(label='2') 二节
                    el-radio(label='3') 三节
                    el-radio(label='4') 四节
                    el-radio(label='5') 五节
</template>

<script type="text/ecmascript-6">
    import FormModel from './model'
    import {CourseArrangementURL} from '../../config.toml'

    export default {
        name: 'CourseArrangementAdd',
        data() {
            return {
                formModel: Object.assign({}, FormModel),
                rules: {
                    classWeeks: [{required: true, type: 'number', message: '请选择或输入学期上课周数', trigger: 'change'}],
                    classPerWeekDays: [{required: true, message: '请选择周排课天数', trigger: 'change'}],
                    classMorningSections: [{required: true, message: '请选择上午日排课节数', trigger: 'change'}],
                    classAfternoonSections: [{required: true, message: '请选择下午日排课节数', trigger: 'change'}],
                    classEveningSections: [{required: true, message: '请选择晚上日排课节数', trigger: 'change'}]
                },
                targetURL: CourseArrangementURL,
                labelWidth: '120px'
            }
        },
        components: {},
        mounted() {
        },
        methods: {}
    }
</script>
